package com.qiandw

import java.io.{BufferedReader, InputStreamReader}

import org.junit.Test
import org.junit.runner.RunWith
import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest
import org.springframework.core.io.{ClassPathResource, Resource}
import org.springframework.test.context.junit4.SpringRunner

@RunWith(classOf[SpringRunner])
@WebFluxTest
class TestAuth {

  @Test
  def readClassPath(): Unit = {
    val resource: Resource = new ClassPathResource("js\\test.js")
    val bufferedReader: BufferedReader = new BufferedReader(new InputStreamReader(resource.getInputStream))
    bufferedReader.lines().reduce((t: String, u: String) => s"$t\n$u").ifPresent(s => println(s))
  }

}
